package com.example.chat.util;

import java.util.Calendar;
import java.util.Date;

/**
 * 获取当前时间工具类
 */
public class DateUtils {

    //获取当前时间
    public static Date Now(){
        Calendar calendar = Calendar.getInstance();
        Date date = calendar.getTime();
        return date;
    }

    //获取6位时间戳
    public static String getSalt(){
        long time = new Date().getTime();
        String salt=Long.toString(time).substring(7,13);
        return salt;
    }

}
